// 楼宇信息
import qs from "qs";
import request from "@/utils/request";
// 配置公共的header
const headers = {
  "Content-Type": "application/json;charset=utf-8"
};
/**
 * @name getDepartmentList
 * @description 获取院系树
 * @author wqy
 * @date 2019-09-05 17:08:55
 */
export function getDepartmentList(data) {
  return request({
    url: "/web/trDept/admin/getDepartmentList",
    method: "get",
    params: data
  });
}
/**
 * @name getDepartmentList
 * @description 获取院系第二级别
 * @author wqy
 * @date 2019-09-05 17:08:55
 */
export function getDepartmentList2(data) {
  return request({
    url: "/web/trDept/admin/getDepartmentList2",
    method: "get",
    params: data
  });
}
/**
 * @name addDepartment
 * @description 添加机构
 * @author wqy
 * @date 2019-09-05 17:08:55
 */
export function addDepartment(data) {
  return request({
    url: "/web/trDept/admin/addDepartment",
    method: "post",
    data: data,
    ...headers
  });
}
/**
 * @name editDepartment
 * @description 编辑机构
 * @author wqy
 * @date 2019-09-05 17:08:55
 */
export function editDepartment(data) {
  return request({
    url: "/web/trDept/admin/editDepartment",
    method: "post",
    data: data,
    ...headers
  });
}
/**
 * @name delDepartment
 * @description 删除机构
 * @author wqy
 * @date 2019-09-05 17:08:55
 */
export function delDepartment(data) {
  return request({
    url: "/web/trDept/admin/delDepartment",
    method: "get",
    params: data
  });
}
/**
 * @name getUserByZzjg
 * @description 根据组织机构查询用户
 * @author wqy
 * @date 2019-09-05 17:08:55
 */
export function getUserByZzjg(data) {
  return request({
    url: "/web/trUserZzjg/admin/getUserByZzjg",
    method: "get",
    params: data
  });
}
/**
 * @name getUserZzjgList
 * @description 根据条件查询用户
 * @author wqy
 * @date 2019-09-05 17:08:55
 */
export function getUserZzjgList(data) {
  return request({
    url: "/web/trUserZzjg/admin/getUserZzjgList",
    method: "get",
    params: data
  });
}
/**
 * @name delUser
 * @description 删除用户
 * @author wqy
 * @date 2019-09-05 17:08:55
 */
export function delUser(data) {
  return request({
    url: "/web/trUserZzjg/admin/delUser",
    method: "post",
    data: data,
    ...headers
  });
}
/**
 * @name getSysZzjgById
 * @description 编辑用户
 * @author wqy
 * @date 2019-09-05 17:08:55
 */
export function getSysZzjgById(data) {
  return request({
    url: "/web/trDept/admin/getSysZzjgById",
    method: "get",
    params: data
  });
}
/**
 * @name addUser
 * @description 给组织机构添加用户
 * @author wqy
 * @date 2019-09-05 17:08:55
 */
export function addUser(data) {
  return request({
    url: "/web/trUserZzjg/admin/addUser",
    method: "post",
    data: data,
    ...headers
  });
}
/**
 * @name getUserList
 * @description 弹窗-条件查询所有用户
 * @author wqy
 * @date 2019-09-05 17:08:55
 */
export function getUserList(data) {
  return request({
    url: "/web/trUserZzjg/admin/getUserList",
    method: "get",
    params: data
  });
}
/**
 * @name getDwList
 * @description 弹窗-单位树形列表
 * @author wqy
 * @date 2019-09-05 17:08:55
 */
export function getDwList(data) {
  return request({
    url: "/web/trUserZzjg/admin/getDwList",
    method: "get",
    params: data
  });
}
/**
 * @name getDwList
 * @description 弹窗-根据单位查询用户
 * @author wqy
 * @date 2019-09-05 17:08:55
 */
export function getUserByDw(data) {
  return request({
    url: "/web/trUserZzjg/admin/getUserByDw",
    method: "get",
    params: data
  });
}
/**
 * @name getDwList
 * @description 弹窗-根据单位查询用户
 * @author wqy
 * @date 2019-09-05 17:08:55
 */
export function updatePassword(data) {
  return request({
    url: "/web/user/updatePassword",
    method: "post",
    data: data,
    ...headers
  });
}
/**
 * @name getZzjgType
 * @description 弹窗-机构类型
 * @author wqy
 * @date 2019-09-05 17:08:55
 */
export function getZzjgType(data) {
  return request({
    url: "/web/trDept/admin/getZzjgType",
    method: "get",
    params: data
  });
}
/**
 * @name getZzjgBrand
 * @description 弹窗-机构类型
 * @author wqy
 * @date 2019-09-05 17:08:55
 */
export function getZzjgBrand(data) {
  return request({
    url: "/web/trDept/admin/getZzjgBrand",
    method: "get",
    params: data
  });
}
/**
 * @name isManager
 * @description 是否是负责人
 * @author wqy
 * @date 2019-09-05 17:08:55
 */
export function isManager(data) {
  return request({
    url: "/web/trUserZzjg/admin/isManager",
    method: "get",
    params: data
  });
}
/**
 * @name addManager
 * @description 是否是负责人
 * @author wqy
 * @date 2019-09-05 17:08:55
 */
export function addManager(data) {
  return request({
    url: "/web/trUserZzjg/admin/addManager",
    method: "get",
    params: data
  });
}
/**
 * @name getCurrentUserZzjgs
 * @description 获取用户所在的部门
 * @author wqy
 * @date 2019-09-05 17:08:55
 */
export function getCurrentUserZzjgs(data) {
  return request({
    url: "/web/trUserZzjg/web/getCurrentUserZzjgs",
    method: "get",
    params: data
  });
}
/**
 * @name getZzjgData
 * @description 根据组织机构id、code、name获取组织机构
 * @param {
 *  id
 *  zzjgCode
 *  zzjgName
 * }
 * @return {}
 * @author cjs1992
 * @date 2020-11-09 15:50:20
 */
export function getZzjgData(data = {}) {
  return request({
    url: "/web/trDept/web/getZzjgData",
    method: "post",
    data
  });
}
/**
 * @name getLocation
 * @description 根据经纬度获取位置信息
 * @param {
 *   location  wd,jd
 *   key
 * }
 * @author cjs
 * @date 2021-08-08 13:23:33
 */
export function getLocation(data) {
  return request({
    url: "/web/map/qq/geo-coder-f",
    method: "get",
    params: data,
    disposeOuter: 1
  });
}

